<template>
 <div class="profile-settings">
   <h2>用户提现设置</h2>

   <!-- 用户名修改表单 -->
   <el-form ref="form" :model="form" label-width="100px">
     <el-form-item label="最大提现额度">
       <el-input v-model="form.maxValue"></el-input>
     </el-form-item>
     <el-form-item label="最小提现额度">
       <el-input v-model="form.minValue"></el-input>
     </el-form-item>
     <el-form-item>
       <el-button type="primary" @click="saveChanges">保存修改</el-button>
     </el-form-item>
   </el-form>
 </div>
</template>

<script>
import { updateDrawdata, getDrawdata } from "@/api/account";
import { mapGetters } from "vuex";
export default {
 data() {
   return {
     form: {},
   };
 },
 computed: {
   ...mapGetters(["uid"]),
 },
 created() {
   this.loadData();
 },
 methods: {
   async saveChanges() {
     const param = {
      maxValue: this.form.maxValue,
      minValue: this.form.minValue,
      setid:1
     };
     const res = await updateDrawdata(param);
     if (res.code == 200) {
       this.$message({
         message: "修改成功",
         type: "success",
       });
     } else {
       this.$message({
         message: "修改有误",
         type: "warning",
       });
     }
   },
   async loadData() {
     
     const res = await getDrawdata(1);

     if (res.code = 200) {
       this.form = res.data.info;
       console.log(this.form);
     }
   },
 },
};
</script>

<style lang="scss" scoped>
/* 添加一些样式以美化页面 */
.profile-settings {
 max-width: 400px;
 
 padding: 20px;
}

.form-group {
 margin-bottom: 15px;
}

label {
 display: block;
 margin-bottom: 5px;
}
</style>
